<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="com.cqggrw.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>公共人物网后台管理</title>
<link type="text/css" rel="Stylesheet" href="../Content/tabbed_pages.css" />
<link type="text/css" rel="Stylesheet" href="../Content/Index.css" />
<script type="text/javascript" src="../../jslib/jquery-1.8.0.min.js"></script>
<script type="text/javascript">
	function WebForm_OnSubmit() {
		if ($('#nameId').val().length == 0) {
			alert("投票项目名称不能为空！");
			return false;
		}
		return true;
	}
</script>
</head>
<body>
	<form name="form1" method="post" action="touPiaoAction!add.action" onsubmit="javascript:return WebForm_OnSubmit();" id="form1" enctype="multipart/form-data">
		<div class="form-div textLeft">
			<h1>
				<span class="action-span"><a href="tpList.jsp">投票列表</a> </span> <span class="action-span1 fs20">公共人物网 管理中心 </span><span class="action-span1 paddingTop5"> - 分类编辑 </span>
			</h1>
			<div style="clear:both"></div>
		</div>
		<div id="gallery">
			<div class="on" title="CommonInfo">
				<span>分类信息</span>
			</div>
			<%
				String message = (String) request.getAttribute("message");
				if (message != null) {
					out.print(message);
				}
			%>
		</div>
		<div id="CommonInfo" class="show">
			<table id="toupiaoTable" width="90%" id="general-table" align="center">
				<tr>
					<td>投票项目： <input name="name" style="width: 300px;" type="text" id="nameId" /> <span id="nameSpan"></span>
					</td>
				</tr>
				<tr id="bb">
					<td>投票选项： <input style="width: 350px;" name="option" type="text" id="optId" /></td>
				</tr>
				<tr>
					<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="button" onclick="addOption();" value="增加选项" /></td>
				</tr>
			</table>
		</div>
		<div class="form-div textLeft" style="text-align:center;margin-top:5px;">
			<input type="submit" name="btnSave" value="保存" onclick="" id="btnSave" class="button" />
		</div>
	</form>
	<script type="text/javascript">
		var addOption = function() {
			var str = '<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' 
				+ '<input style="width: 350px;" name="option" type="text"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" onclick="delOption(this);" value="删除选项" /></td></tr>';
			$('#toupiaoTable tr:last-child').before(str);
		};
		
		var delOption = function(obj) {
			$(obj).parent().parent().remove();
		};
	</script>
</body>
</html>